package ru.royalgatemagazine.afisha.splash;

import ru.royalgatemagazine.afisha.PageActivity;
import ru.royalgatemagazine.afisha.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;

public class SplashActivity extends Activity {
	
	public static final int delay = 1500;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
    }
    
    @Override
    protected void onResume() {
    	super.onResume();
    	new Handler().postDelayed(new Runnable() {
			@Override
			public void run() {
				Intent intent = getIntent();
				startActivity(intent);
				finish();
			}
		}, delay);
    }
    
    public Intent getIntent(){
    	return new Intent(this, PageActivity.class);
    }
    
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    	return true;
    }
}
